package SingletonPattern.exercise5_1;

//非Singleton版本
//public class TicketMaker {
//    private int ticket = 1000;
//    public int getNextTicketNumber(){
//        return ticket++;
//    }
//}

public class TicketMaker {
    private int ticket = 1000;
    private static TicketMaker instance = new TicketMaker();

    private TicketMaker() {

    }

    public static TicketMaker getInstance(){
        return instance;
    }

    public int getNextTicketNumber() {
        return ticket++;
    }
}

